<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ADNS2080 mouse sensor example</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51 General Code Examples
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__adns2080__example.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">ADNS2080 mouse sensor example</div>  </div>
<div class="ingroups"><a class="el" href="group__nrf__examples__nrf6310.html">nRF6310 example projects</a></div></div>
<div class="contents">

<p>Example project on ADNS2080 mouse sensor driver.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#gac00d3901322b185ce43c8880002d5cec">MOTION_INTERRUPT_PIN_NUMBER</a>&#160;&#160;&#160;(26)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#gab40852b1215a406349ec1921d2d4f53a">MOUSE_MOVEMENT_THRESHOLD</a>&#160;&#160;&#160;(10)</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#gad22626704ea5d45f863163500e355cc3">gpiote_init</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#ga26b108e2296d5514a2391960b4231d71">GPIOTE_IRQHandler</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga739645fd905c0e19ec6a93609205fd5d"></a><!-- doxytag: member="adns2080_example::m_delta_x" ref="ga739645fd905c0e19ec6a93609205fd5d" args="" -->
static int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#ga739645fd905c0e19ec6a93609205fd5d">m_delta_x</a> = 0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Variable to store mouse X-axis movement deltas. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab44d8c3d8e8c57e752ff5c17561021ef"></a><!-- doxytag: member="adns2080_example::m_delta_y" ref="gab44d8c3d8e8c57e752ff5c17561021ef" args="" -->
static int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#gab44d8c3d8e8c57e752ff5c17561021ef">m_delta_y</a> = 0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Variable to store mouse Y-axis movement deltas. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4751f749a53b728f17460a69cf06d225"></a><!-- doxytag: member="adns2080_example::motion_interrupt_detected" ref="ga4751f749a53b728f17460a69cf06d225" args="" -->
static bool volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__adns2080__example.html#ga4751f749a53b728f17460a69cf06d225">motion_interrupt_detected</a> = false</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">If set, motion interrupt has occurred. Clear after reading. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Example project on ADNS2080 mouse sensor driver. </p>
<p>This example demostrates how to use ADNS2080 mouse sensor (and driver) to read mouse movement. When mouse is moved left, four leftmost LEDs are lit and when mouse is moved right, four rightmost LEDs are lit.</p>
<p>ADNS2080 clock line is connected to pin 24, data line to pin 25 and motion interrupt to pin 26. Note that on nRF2752 board, you need to to put the P4 jumpers to position closer to the center of the board in order to have the GPIO pin 26 routed to the chip. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gac00d3901322b185ce43c8880002d5cec"></a><!-- doxytag: member="main.c::MOTION_INTERRUPT_PIN_NUMBER" ref="gac00d3901322b185ce43c8880002d5cec" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MOTION_INTERRUPT_PIN_NUMBER&#160;&#160;&#160;(26)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Pin number to used for ADNS2080 motion interrupt. If you change this, also remember to change the pin configuration in the main function. </p>

<p>Definition at line <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html#l00040">40</a> of file <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html">main.c</a>.</p>

</div>
</div>
<a class="anchor" id="gab40852b1215a406349ec1921d2d4f53a"></a><!-- doxytag: member="main.c::MOUSE_MOVEMENT_THRESHOLD" ref="gab40852b1215a406349ec1921d2d4f53a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MOUSE_MOVEMENT_THRESHOLD&#160;&#160;&#160;(10)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the deadzone for mouse movement before LEDs are lit </p>

<p>Definition at line <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html#l00041">41</a> of file <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html">main.c</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gad22626704ea5d45f863163500e355cc3"></a><!-- doxytag: member="main.c::gpiote_init" ref="gad22626704ea5d45f863163500e355cc3" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void gpiote_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initializes GPIO Tasks/Events peripheral. </p>

<p>Definition at line <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html#l00050">50</a> of file <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html">main.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga26b108e2296d5514a2391960b4231d71"></a><!-- doxytag: member="main.c::GPIOTE_IRQHandler" ref="ga26b108e2296d5514a2391960b4231d71" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GPIOTE_IRQHandler </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>GPIOTE interrupt handler. Triggered on motion interrupt pin input low-to-high transition. </p>

<p>Definition at line <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html#l00070">70</a> of file <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html">main.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a><!-- doxytag: member="main.c::main" ref="ga840291bc02cba5474a4cb46a9b9566fe" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><a class="el" href="group__gpio__example.html#ga840291bc02cba5474a4cb46a9b9566fe">main()</a> function </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0. int return type required by ANSI/ISO standard. </dd></dl>

<p>Definition at line <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html#l00082">82</a> of file <a class="el" href="nrf6310_2ext__sensors_2adns2080__example_2main_8c_source.html">main.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
